<?php if ($this->acl['index']): ?>
<a href="<?php echo $this->baseUrl(); ?>/admin/custom/" class="ui-state-default ui-corner-all linkButton"><?php echo $this->translate("admin-custom-details:linkBack"); ?><span class="ui-icon ui-icon-triangle-1-w"></span></a>
<?php endif; ?>
<?php if ($this->acl['add']) : ?>
<a href="<?php echo $this->baseUrl(); ?>/admin/custom/add/?objectId=<?php echo $this->objectId; ?>" class="ui-state-default ui-corner-all linkButton"><?php echo $this->translate("admin-custom-details:linkAdd", $this->objectId); ?><span class="ui-icon ui-icon-plusthick"></span></a>
<br /><br />
<?php endif; ?>
<table class="form">
    <tbody>
	    <tr>
	        <td width="100"><label><?php echo $this->translate("admin-custom-form:object"); ?></label></td>
	        <td><?php echo $this->objectId; ?></td>
	    </tr>
	    <tr>
	        <td><label><?php echo $this->translate("admin-custom-form:description"); ?></label></td>
	        <td><?php echo $this->objectDescription; ?></td>
	    </tr>
    </tbody>
</table>
<br />
<button type="button" id="saveButton"><?php echo $this->translate("admin-custom-details:linkSaveOrder"); ?></button> <span id="orderMessage" class="ui-corner-all"></span>
<input id="objectId" type="hidden" value="<?php echo $this->objectId; ?>" />
    
<?php if (count($this->attributes) > 0) : ?>
    <ul id="attributeList" class="ui-sortable">
        <?php foreach ($this->attributes as $a) : ?>
            <li id="attribute_<?php echo $a['attributeId']; ?>" class="ui-state-default">
                <table>
                    <tbody>
                        <tr>
                            <td>
                                <span class="ui-icon ui-icon-arrowthick-2-n-s dragIndicator"></span>
                                <?php if ($this->acl['attributeDetails']) : ?>
                                    <a href="<?php echo $this->baseUrl(); ?>/admin/custom/attribute-details/?attributeId=<?php echo $a['attributeId']; ?>"><?php echo $this->truncate($a['label'], 50); ?></a>
                                <?php else : ?>
                                    <?php echo $this->truncate($a['label'], 50); ?>
                                <?php endif;  ?>
                                (<?php echo $a['type']; ?>)
                            </td>
                            <td class="controlButtons">
                                <?php if ($this->acl['edit']) : ?>
                                    <a href="<?php echo $this->baseUrl(); ?>/admin/custom/edit/?attributeId=<?php echo $a['attributeId']; ?>" class="ui-state-default ui-corner-all linkButtonNoText">&nbsp;<span class="ui-icon ui-icon-pencil"></span></a>
                                <?php endif; ?>&nbsp;
                                <?php if ($this->acl['delete']) : ?>
                                    <a href="<?php echo $this->baseUrl(); ?>/admin/custom/delete/?attributeId=<?php echo $a['attributeId']; ?>" class="ui-state-default ui-corner-all linkButtonNoText">&nbsp;<span class="ui-icon ui-icon-minusthick"></span></a>
                                <?php endif; ?>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </li>
        <?php endforeach; ?>
    </ul>
<?php else : ?>
        <?php echo $this->translate("admin-custom-details:noAttributes"); ?>
<?php endif; ?>